package com.xiaohu.sql

import org.apache.spark.sql.SparkSession

object Demo10HiveOnSpark {
  def main(args: Array[String]): Unit = {
    val sparkSession: SparkSession = SparkSession.builder()
      .master("local")
      .appName("提交到yarn 计算每个班级的人数")
      //参数设置的优先级：代码优先级 > 命令优先级 > 配置文件优先级
      .config("spark.sql.shuffle.partitions", "1")
      .enableHiveSupport() // 开启hive的配置
      .getOrCreate()

    sparkSession.sql("use bigdata30")

    sparkSession.sql("select * from sqoop_students1 limit 10").show(truncate = false)

    
  }
}
